<fieldset>
    <legend>操作</legend>
    <form action="{:request()->url()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get"
          onsubmit="return false">

        <div class="layui-form-item layui-inline">

            <!--{if auth("indexExport")}-->
            <button class="layui-btn layui-btn-primary"
                    data-form-export="{:url('indexExport')}?month={:input('month')}"
                    type="button">
                <i class="layui-icon layui-icon-export"></i> 导 出
            </button>
            <!--{/if}-->
        </div>
    </form>

</fieldset>

<script>
    window.form.render();
    require(['excel'], function (excel) {
        excel.bind(function (data) {
            var items = [];
            items.push([
            '对接日期',
            '城市',
            '司机',
            '车牌',
            '电话',
            '车型',
            '结算车型',
            '车身颜色',
            {if session('user.username') eq 'LiuLiang'}
            '单价',
            '覆盖收费',
            '总额',
            {/if}
            '尾部扣除',
            '尾部喷漆',
            '覆盖',
            '返工',
            '覆盖几面',
            ]);

            data.forEach(function (item, index) {
                items.push([
                    item.time_docking ,
                    item.city + item.area,
                    item.username || '',
                    item.plate_number || '',
                    item.phone || '',
                    item.car_vehicle_type || '',
                    item.car_vehicle_type_num || '',
                    item.car_color || '',
                    {if session('user.username') eq 'LiuLiang'}
                    item.platform_price || '',
                    item.cover_price || '',
                    parseFloat(parseFloat(item.platform_price) + parseFloat(item.cover_price)),
                    {/if}
                    '',
                    item.has_cover === 0 ? '否' : '是',
                    item.end_paint_status === 1 ? '是' : '否',
                    item.is_rework === 1 ? '是' : '否',
                    item.cover_num || '',



                ]);
            });
            return items;
        }, '客户结算数据');
    });

</script>
